Send Program Resource to Report
Hello everyone!
I am working on a new report and want to display some icons / resources from my application in the report.
Is this possible? I know that I can send file paths to the report and have it load the image in the report, but can I send actual resources? They're very small files, only icons, but there are several of them...
I was playing around with this, but I don't see a function that seems like it would do this, so I wanted to ask on here.
I appreciate the help as always!
I am working on a new report and want to display some icons / resources from my application in the report.
Is this possible? I know that I can send file paths to the report and have it load the image in the report, but can I send actual resources? They're very small files, only icons, but there are several of them...
I was playing around with this, but I don't see a function that seems like it would do this, so I wanted to ask on here.
I appreciate the help as always!
Comments
Thank you very much, I appreciate your help.
One quick question, is this limited to one resource? I've been working on this today and I can get one to populate in the report, but no more...
I'm going to work on this again tomorrow, maybe I can figure it out. It just seemed odd that the code worked for one image, but not for the other images...
Thanks Again!
and in report script:
I was able to get this working, by commenting out the Parameter.Name line like this:
// create parameter
FastReport.Data.Parameter parameter = new FastReport.Data.Parameter();
//parameter.Name = "Logo";
parameter.DataType = typeof(Byte[]);
report.Dictionary.Parameters.Add(parameter);
report.SetParameterValue("Logo", logo);
Not sure why, but with that line included the images weren't displaying in the report. The one that was working had a typo in that line, which is how I noticed this.
Just figured I would let you know, as it seemed a bit strange to me.
But it is working now and I wanted to thank you for your help!